package algocity.view;

import java.awt.event.ActionListener;

import javax.swing.JButton;

public class Boton extends JButton {

	private static final long serialVersionUID = 8962906029783975011L;

	public Boton(String label, ActionListener ctrl){
		super(label);
		alinear();
		addActionListener(ctrl);
	}
	
	public Boton(String label){
		super(label);
		alinear();
	}
	
	public void alinear(){
		setAlignmentX(CENTER_ALIGNMENT);
		setAlignmentY(CENTER);
	}
	
	public String toString(){
		return getLabel();
	}
	
	public void setComando(String comando){
		setActionCommand(comando);
	}
	
}
